1. Field of the Invention
This invention relates to a clock source selector which is capable of switching between two asynchronous clock sources with different clock rates and back again in a glitch-free manner. Such a clock source selector is sometimes termed a glitch-free multiplexer.
2. Description of the Related Art
In integrated circuit technology there is sometimes a need to switch between two clock sources which are unrelated in rate and phase. It is important that in such switching any glitch, or short pulse, is avoided. The generation of a glitch is illustrated in FIG. 1 of the drawings, which shows two clock waveforms A and B. A switch request signal indicates whether clock A is required or clock B. If clock A is required the switch request (SW-RQ) signal takes a low value, and if clock B is required the switch request signal takes a high value. If the switch request signal is used directly to select clock A or clock B, the output shown at the bottom of the figure is obtained. This includes a short pulse at the point of the changeover, which is unacceptable for many applications. A similar glitch can occur when switching back from clock B to clock A. A glitch-free multiplexer is designed to overcome this problem, and thus is designed so as not to violate the minimum acceptable pulse width.
Known glitch-free multiplexers use state machines and are relatively complex and difficult to test. There is a need for a reliable glitch-free multiplexer which is easy to make and to test, which is reliable when having to cope with successive switch requests, and which does not introduce unnecessary delay.
A preferred embodiment of the invention, described in more detail below with reference to the drawings, takes the form of a clock source for selecting either a first clock signal A or a second clock signal B in accordance with a switch request signal. The clock source includes three retiming circuits each consisting of two clocked flip-flops. The switch request signal is first retimed relative to clock A to give a signal P, is then retimed relative to clock B to give a signal Q, and finally is retimed relative to clock A to give a signal R. Selector circuitry operates such that when signal Q is asserted, the second clock signal B is output, when neither signal P nor signal R, as combined by a NOR gate, are asserted, the first clock signal A is output, and at other times a logic one level is output. The clock source can be used in an integrated circuit to form a glitch-free multiplexer.